Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

RiCal::OccurrenceEnumerator#occurrences ignores an original event

#32

In the following code, the recurrence of the third event "Event3" ignores the original event
starting at "2009/2/2 14:00:00".
When I set RRULE property (Event1 and Event2), this does not occur.
When I set RDATE property without RRULE property,
the method RiCal::OccurrenceEnumerator#occurrences ignores the original event.

require 'ri_cal'

calendar = RiCal.Calendar do |cal|
  cal.event do |event|
    event.summary = "Event1"
    event.dtstart = DateTime.parse("2009/2/2 14:00:00")
    event.dtend = DateTime.parse("2009/2/2 15:00:00")
    event.add_rrule('FREQ=WEEKLY;BYDAY=TH;UNTIL=20090301')
  end

  cal.event do |event|
    event.summary = "Event2"
    event.dtstart = DateTime.parse("2009/2/2 14:00:00")
    event.dtend = DateTime.parse("2009/2/2 15:00:00")
    event.add_rrule('FREQ=WEEKLY;BYDAY=TH;UNTIL=20090301')
    event.add_rdate(DateTime.parse("2009/2/4 16:00:00"), DateTime.parse("2009/2/5 16:00:00"))
  end

  cal.event do |event|
    event.summary = "Event3"
    event.dtstart = DateTime.parse("2009/2/2 14:00:00")
    event.dtend = DateTime.parse("2009/2/2 15:00:00")
    event.add_rdate(DateTime.parse("2009/2/4 16:00:00"), DateTime.parse("2009/2/5 16:00:00"))
  end
end

calendar.events.each do |ev|
  ev.occurrences.each do |oc|
    puts "#{oc.summary}\t#{oc.start_time} - #{oc.finish_time}"
  end
  puts ""
end

Reported by Takayuki Yamaguchi · August 8th, 2010 @ 06:19 AM

State: new
Milestone: none
Assigned to: Rick DeNatale Rick DeNatale

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.